package com.crm.jdy.service.client;

import com.crm.jdy.common.dto.ActivitiBasunessDto;
import com.crm.jdy.common.pojo.ActivitiBasuness;
import com.crm.jdy.common.mapper.ActivitiBasunessMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

/**   
 * @Description:(业务流程审批服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class ActivitiBasunessServiceImpl  extends ServiceImpl<ActivitiBasunessMapper,ActivitiBasuness> implements ActivitiBasunessService  {

    @Autowired
    ActivitiBasunessMapper activitiBasunessMapper;

    @Override
    public boolean removeActivitiBasuness(String aid) {
        return activitiBasunessMapper.deleteById(aid)>0;
    }

    @Override
    public boolean addActivitiBasuness(ActivitiBasuness basuness) {
        return activitiBasunessMapper.insert(basuness) > 0;
    }

    @Override
    public boolean updateActivitiBasuness(ActivitiBasuness basuness) {
        return activitiBasunessMapper.updateById(basuness) > 0;
    }

    @Override
    public PageInfo<ActivitiBasuness> seleteActivitiBasuness(ActivitiBasunessDto basuness) {
        PageHelper.startPage( basuness.getCurrentPage(),basuness.getPageSize());
        List<ActivitiBasuness> bookList = activitiBasunessMapper.seleteActivitiBasuness(basuness);
        PageInfo<ActivitiBasuness> pageInfo = new PageInfo<ActivitiBasuness>(bookList);
        return pageInfo;
    }
}